<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>class Racc::Parser - rdoc: Ruby Standard Library Documentation</title>


<script src="../js/navigation.js" defer></script>
<script src="../js/search.js" defer></script>
<script src="../js/search_index.js" defer></script>
<script src="../js/searcher.js" defer></script>
<script src="../js/darkfish.js" defer></script>

<script src="../js/jquery-3.2.0.min.js"></script>

<script src="../js/vue.min.js"></script>
<script src="../js/js.cookie.min.js"></script>

<link href="../css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="../css/rdoc.css" rel="stylesheet">
<link href="../css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../";
  var index_rel_prefix = "../";
  var darkModeCsseHref = "../css/rdoc-dm.css"
  var defaultModeCssHref = "../css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="class">
  <!-- this is class.html -->

  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0.preview2 NOT FOUND -->
  </div> <!-- end action bar -->

  <div class='wrapper hdiv'>

    


    <nav id='vapp' role="navigation">
    <div id="project-navigation">
      <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="../index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="../table_of_contents.html#pages">Pages</a>
    <a href="../table_of_contents.html#classes">Classes</a>
    <a href="../table_of_contents.html#methods">Methods</a>
  </div>
</div>

      <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

    </div>


    

    <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>
    <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
      <div id="class-metadata">
        
        
<div id="parent-class-section" class="nav-section">
  <h3>Parent</h3>

  <p class="link"><a href="../Object.html">Object</a>
</div>

        
        
        
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li ><a href="#method-i-_racc_do_parse_rb">#_racc_do_parse_rb</a>
    <li ><a href="#method-i-_racc_do_reduce">#_racc_do_reduce</a>
    <li ><a href="#method-i-_racc_evalact">#_racc_evalact</a>
    <li ><a href="#method-i-_racc_init_sysvars">#_racc_init_sysvars</a>
    <li ><a href="#method-i-_racc_setup">#_racc_setup</a>
    <li ><a href="#method-i-_racc_yyparse_rb">#_racc_yyparse_rb</a>
    <li ><a href="#method-i-next_token">#next_token</a>
    <li ><a href="#method-i-on_error">#on_error</a>
    <li ><a href="#method-i-racc_accept">#racc_accept</a>
    <li ><a href="#method-i-racc_e_pop">#racc_e_pop</a>
    <li ><a href="#method-i-racc_next_state">#racc_next_state</a>
    <li ><a href="#method-i-racc_print_stacks">#racc_print_stacks</a>
    <li ><a href="#method-i-racc_print_states">#racc_print_states</a>
    <li ><a href="#method-i-racc_read_token">#racc_read_token</a>
    <li ><a href="#method-i-racc_reduce">#racc_reduce</a>
    <li ><a href="#method-i-racc_shift">#racc_shift</a>
    <li ><a href="#method-i-racc_token2str">#racc_token2str</a>
    <li ><a href="#method-i-token_to_str">#token_to_str</a>
    <li ><a href="#method-i-yyaccept">#yyaccept</a>
    <li ><a href="#method-i-yyerrok">#yyerrok</a>
    <li ><a href="#method-i-yyerror">#yyerror</a>
  </ul>
</div>

      </div>
     </div>
    </nav>


    <div id='extraz'><div class='adzbox-index'  >
      
     </div>         
    </div>

    <main role="main" aria-labelledby="class-Racc::Parser">
    <h1 id="class-Racc::Parser" class="class">
      class Racc::Parser
    </h1>

    <section class="description">
    
    </section>

      <section id="5Buntitled-5D" class="documentation-section">


      <section class="constants-list">
      <header>
      <h3>Constants</h3>
      </header>
      <dl>
          <dt id="Racc_Runtime_Core_Version_R">Racc_Runtime_Core_Version_R
          <dd>
          <dt id="Racc_Runtime_Version">Racc_Runtime_Version
          <dd>
        </dl>
        </section>



                <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Instance Methods</h3>
                </header>

                  <div id="method-i-_racc_do_parse_rb" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">_racc_do_parse_rb</span><span
                                class="method-args">(arg, in_debug)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="_racc_do_parse_rb-source">
            <pre><span class="ruby-comment"># File rdoc/rd/block_parser.rb, line 312</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">_racc_do_parse_rb</span>(<span class="ruby-identifier">arg</span>, <span class="ruby-identifier">in_debug</span>)
  <span class="ruby-identifier">action_table</span>, <span class="ruby-identifier">action_check</span>, <span class="ruby-identifier">action_default</span>, <span class="ruby-identifier">action_pointer</span>,
  <span class="ruby-identifier">_</span>,            <span class="ruby-identifier">_</span>,            <span class="ruby-identifier">_</span>,              <span class="ruby-identifier">_</span>,
  <span class="ruby-identifier">_</span>,            <span class="ruby-identifier">_</span>,            <span class="ruby-identifier">token_table</span>,    <span class="ruby-operator">*</span> = <span class="ruby-identifier">arg</span>

  <span class="ruby-identifier">_racc_init_sysvars</span>
  <span class="ruby-identifier">tok</span> = <span class="ruby-identifier">act</span> = <span class="ruby-identifier">i</span> = <span class="ruby-keyword">nil</span>

  <span class="ruby-identifier">catch</span>(<span class="ruby-value">:racc_end_parse</span>) {
    <span class="ruby-keyword">while</span> <span class="ruby-keyword">true</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">i</span> = <span class="ruby-identifier">action_pointer</span>[<span class="ruby-ivar">@racc_state</span>[<span class="ruby-value">-1</span>]]
        <span class="ruby-keyword">if</span> <span class="ruby-ivar">@racc_read_next</span>
          <span class="ruby-keyword">if</span> <span class="ruby-ivar">@racc_t</span> <span class="ruby-operator">!=</span> <span class="ruby-value">0</span>   <span class="ruby-comment"># not EOF</span>
            <span class="ruby-identifier">tok</span>, <span class="ruby-ivar">@racc_val</span> = <span class="ruby-identifier">next_token</span>()
            <span class="ruby-keyword">unless</span> <span class="ruby-identifier">tok</span>      <span class="ruby-comment"># EOF</span>
              <span class="ruby-ivar">@racc_t</span> = <span class="ruby-value">0</span>
            <span class="ruby-keyword">else</span>
              <span class="ruby-ivar">@racc_t</span> = (<span class="ruby-identifier">token_table</span>[<span class="ruby-identifier">tok</span>] <span class="ruby-keyword">or</span> <span class="ruby-value">1</span>)   <span class="ruby-comment"># error token</span>
            <span class="ruby-keyword">end</span>
            <span class="ruby-identifier">racc_read_token</span>(<span class="ruby-ivar">@racc_t</span>, <span class="ruby-identifier">tok</span>, <span class="ruby-ivar">@racc_val</span>) <span class="ruby-keyword">if</span> <span class="ruby-ivar">@yydebug</span>
            <span class="ruby-ivar">@racc_read_next</span> = <span class="ruby-keyword">false</span>
          <span class="ruby-keyword">end</span>
        <span class="ruby-keyword">end</span>
        <span class="ruby-identifier">i</span> <span class="ruby-operator">+=</span> <span class="ruby-ivar">@racc_t</span>
        <span class="ruby-keyword">unless</span> <span class="ruby-identifier">i</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-value">0</span> <span class="ruby-keyword">and</span>
               <span class="ruby-identifier">act</span> = <span class="ruby-identifier">action_table</span>[<span class="ruby-identifier">i</span>] <span class="ruby-keyword">and</span>
               <span class="ruby-identifier">action_check</span>[<span class="ruby-identifier">i</span>] <span class="ruby-operator">==</span> <span class="ruby-ivar">@racc_state</span>[<span class="ruby-value">-1</span>]
          <span class="ruby-identifier">act</span> = <span class="ruby-identifier">action_default</span>[<span class="ruby-ivar">@racc_state</span>[<span class="ruby-value">-1</span>]]
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-identifier">act</span> = <span class="ruby-identifier">action_default</span>[<span class="ruby-ivar">@racc_state</span>[<span class="ruby-value">-1</span>]]
      <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">while</span> <span class="ruby-identifier">act</span> = <span class="ruby-identifier">_racc_evalact</span>(<span class="ruby-identifier">act</span>, <span class="ruby-identifier">arg</span>)
        ;
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
  }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-_racc_do_reduce" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">_racc_do_reduce</span><span
                                class="method-args">(arg, act)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="_racc_do_reduce-source">
            <pre><span class="ruby-comment"># File rdoc/rd/block_parser.rb, line 512</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">_racc_do_reduce</span>(<span class="ruby-identifier">arg</span>, <span class="ruby-identifier">act</span>)
  <span class="ruby-identifier">_</span>,          <span class="ruby-identifier">_</span>,            <span class="ruby-identifier">_</span>,            <span class="ruby-identifier">_</span>,
  <span class="ruby-identifier">goto_table</span>, <span class="ruby-identifier">goto_check</span>,   <span class="ruby-identifier">goto_default</span>, <span class="ruby-identifier">goto_pointer</span>,
  <span class="ruby-identifier">nt_base</span>,    <span class="ruby-identifier">reduce_table</span>, <span class="ruby-identifier">_</span>,            <span class="ruby-identifier">_</span>,
  <span class="ruby-identifier">_</span>,          <span class="ruby-identifier">use_result</span>,   <span class="ruby-operator">*</span> = <span class="ruby-identifier">arg</span>

  <span class="ruby-identifier">state</span> = <span class="ruby-ivar">@racc_state</span>
  <span class="ruby-identifier">vstack</span> = <span class="ruby-ivar">@racc_vstack</span>
  <span class="ruby-identifier">tstack</span> = <span class="ruby-ivar">@racc_tstack</span>

  <span class="ruby-identifier">i</span> = <span class="ruby-identifier">act</span> <span class="ruby-operator">*</span> <span class="ruby-value">-3</span>
  <span class="ruby-identifier">len</span>       = <span class="ruby-identifier">reduce_table</span>[<span class="ruby-identifier">i</span>]
  <span class="ruby-identifier">reduce_to</span> = <span class="ruby-identifier">reduce_table</span>[<span class="ruby-identifier">i</span><span class="ruby-value">+1</span>]
  <span class="ruby-identifier">method_id</span> = <span class="ruby-identifier">reduce_table</span>[<span class="ruby-identifier">i</span><span class="ruby-value">+2</span>]
  <span class="ruby-identifier">void_array</span> = []

  <span class="ruby-identifier">tmp_t</span> = <span class="ruby-identifier">tstack</span>[<span class="ruby-operator">-</span><span class="ruby-identifier">len</span>, <span class="ruby-identifier">len</span>] <span class="ruby-keyword">if</span> <span class="ruby-ivar">@yydebug</span>
  <span class="ruby-identifier">tmp_v</span> = <span class="ruby-identifier">vstack</span>[<span class="ruby-operator">-</span><span class="ruby-identifier">len</span>, <span class="ruby-identifier">len</span>]
  <span class="ruby-identifier">tstack</span>[<span class="ruby-operator">-</span><span class="ruby-identifier">len</span>, <span class="ruby-identifier">len</span>] = <span class="ruby-identifier">void_array</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@yydebug</span>
  <span class="ruby-identifier">vstack</span>[<span class="ruby-operator">-</span><span class="ruby-identifier">len</span>, <span class="ruby-identifier">len</span>] = <span class="ruby-identifier">void_array</span>
  <span class="ruby-identifier">state</span>[<span class="ruby-operator">-</span><span class="ruby-identifier">len</span>, <span class="ruby-identifier">len</span>]  = <span class="ruby-identifier">void_array</span>

  <span class="ruby-comment"># tstack must be updated AFTER method call</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">use_result</span>
    <span class="ruby-identifier">vstack</span>.<span class="ruby-identifier">push</span> <span class="ruby-identifier">__send__</span>(<span class="ruby-identifier">method_id</span>, <span class="ruby-identifier">tmp_v</span>, <span class="ruby-identifier">vstack</span>, <span class="ruby-identifier">tmp_v</span>[<span class="ruby-value">0</span>])
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">vstack</span>.<span class="ruby-identifier">push</span> <span class="ruby-identifier">__send__</span>(<span class="ruby-identifier">method_id</span>, <span class="ruby-identifier">tmp_v</span>, <span class="ruby-identifier">vstack</span>)
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">tstack</span>.<span class="ruby-identifier">push</span> <span class="ruby-identifier">reduce_to</span>

  <span class="ruby-identifier">racc_reduce</span>(<span class="ruby-identifier">tmp_t</span>, <span class="ruby-identifier">reduce_to</span>, <span class="ruby-identifier">tstack</span>, <span class="ruby-identifier">vstack</span>) <span class="ruby-keyword">if</span> <span class="ruby-ivar">@yydebug</span>

  <span class="ruby-identifier">k1</span> = <span class="ruby-identifier">reduce_to</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">nt_base</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">i</span> = <span class="ruby-identifier">goto_pointer</span>[<span class="ruby-identifier">k1</span>]
    <span class="ruby-identifier">i</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">state</span>[<span class="ruby-value">-1</span>]
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">i</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-value">0</span> <span class="ruby-keyword">and</span> (<span class="ruby-identifier">curstate</span> = <span class="ruby-identifier">goto_table</span>[<span class="ruby-identifier">i</span>]) <span class="ruby-keyword">and</span> <span class="ruby-identifier">goto_check</span>[<span class="ruby-identifier">i</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">k1</span>
      <span class="ruby-keyword">return</span> <span class="ruby-identifier">curstate</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">goto_default</span>[<span class="ruby-identifier">k1</span>]
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-_racc_evalact" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">_racc_evalact</span><span
                                class="method-args">(act, arg)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>common</p>

                              <div class="method-source-code" id="_racc_evalact-source">
            <pre><span class="ruby-comment"># File rdoc/rd/block_parser.rb, line 415</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">_racc_evalact</span>(<span class="ruby-identifier">act</span>, <span class="ruby-identifier">arg</span>)
  <span class="ruby-identifier">action_table</span>, <span class="ruby-identifier">action_check</span>, <span class="ruby-identifier">_</span>, <span class="ruby-identifier">action_pointer</span>,
  <span class="ruby-identifier">_</span>,            <span class="ruby-identifier">_</span>,            <span class="ruby-identifier">_</span>, <span class="ruby-identifier">_</span>,
  <span class="ruby-identifier">_</span>,            <span class="ruby-identifier">_</span>,            <span class="ruby-identifier">_</span>, <span class="ruby-identifier">shift_n</span>,
  <span class="ruby-identifier">reduce_n</span>,     <span class="ruby-operator">*</span> = <span class="ruby-identifier">arg</span>
  <span class="ruby-identifier">nerr</span> = <span class="ruby-value">0</span>   <span class="ruby-comment"># tmp</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">act</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">act</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">shift_n</span>
    <span class="ruby-comment">#</span>
    <span class="ruby-comment"># shift</span>
    <span class="ruby-comment">#</span>
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@racc_error_status</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
      <span class="ruby-ivar">@racc_error_status</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@racc_t</span> <span class="ruby-operator">&lt;=</span> <span class="ruby-value">1</span> <span class="ruby-comment"># error token or EOF</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-ivar">@racc_vstack</span>.<span class="ruby-identifier">push</span> <span class="ruby-ivar">@racc_val</span>
    <span class="ruby-ivar">@racc_state</span>.<span class="ruby-identifier">push</span> <span class="ruby-identifier">act</span>
    <span class="ruby-ivar">@racc_read_next</span> = <span class="ruby-keyword">true</span>
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@yydebug</span>
      <span class="ruby-ivar">@racc_tstack</span>.<span class="ruby-identifier">push</span> <span class="ruby-ivar">@racc_t</span>
      <span class="ruby-identifier">racc_shift</span> <span class="ruby-ivar">@racc_t</span>, <span class="ruby-ivar">@racc_tstack</span>, <span class="ruby-ivar">@racc_vstack</span>
    <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">act</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">0</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">act</span> <span class="ruby-operator">&gt;</span> <span class="ruby-operator">-</span><span class="ruby-identifier">reduce_n</span>
    <span class="ruby-comment">#</span>
    <span class="ruby-comment"># reduce</span>
    <span class="ruby-comment">#</span>
    <span class="ruby-identifier">code</span> = <span class="ruby-identifier">catch</span>(<span class="ruby-value">:racc_jump</span>) {
      <span class="ruby-ivar">@racc_state</span>.<span class="ruby-identifier">push</span> <span class="ruby-identifier">_racc_do_reduce</span>(<span class="ruby-identifier">arg</span>, <span class="ruby-identifier">act</span>)
      <span class="ruby-keyword">false</span>
    }
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">code</span>
      <span class="ruby-keyword">case</span> <span class="ruby-identifier">code</span>
      <span class="ruby-keyword">when</span> <span class="ruby-value">1</span> <span class="ruby-comment"># yyerror</span>
        <span class="ruby-ivar">@racc_user_yyerror</span> = <span class="ruby-keyword">true</span>   <span class="ruby-comment"># user_yyerror</span>
        <span class="ruby-keyword">return</span> <span class="ruby-operator">-</span><span class="ruby-identifier">reduce_n</span>
      <span class="ruby-keyword">when</span> <span class="ruby-value">2</span> <span class="ruby-comment"># yyaccept</span>
        <span class="ruby-keyword">return</span> <span class="ruby-identifier">shift_n</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-identifier">raise</span> <span class="ruby-string">&#39;[Racc Bug] unknown jump code&#39;</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">act</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">shift_n</span>
    <span class="ruby-comment">#</span>
    <span class="ruby-comment"># accept</span>
    <span class="ruby-comment">#</span>
    <span class="ruby-identifier">racc_accept</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@yydebug</span>
    <span class="ruby-identifier">throw</span> <span class="ruby-value">:racc_end_parse</span>, <span class="ruby-ivar">@racc_vstack</span>[<span class="ruby-value">0</span>]

  <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">act</span> <span class="ruby-operator">==</span> <span class="ruby-operator">-</span><span class="ruby-identifier">reduce_n</span>
    <span class="ruby-comment">#</span>
    <span class="ruby-comment"># error</span>
    <span class="ruby-comment">#</span>
    <span class="ruby-keyword">case</span> <span class="ruby-ivar">@racc_error_status</span>
    <span class="ruby-keyword">when</span> <span class="ruby-value">0</span>
      <span class="ruby-keyword">unless</span> <span class="ruby-identifier">arg</span>[<span class="ruby-value">21</span>]    <span class="ruby-comment"># user_yyerror</span>
        <span class="ruby-identifier">nerr</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
        <span class="ruby-identifier">on_error</span> <span class="ruby-ivar">@racc_t</span>, <span class="ruby-ivar">@racc_val</span>, <span class="ruby-ivar">@racc_vstack</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">when</span> <span class="ruby-value">3</span>
      <span class="ruby-keyword">if</span> <span class="ruby-ivar">@racc_t</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>   <span class="ruby-comment"># is $</span>
        <span class="ruby-comment"># We&#39;re at EOF, and another error occurred immediately after</span>
        <span class="ruby-comment"># attempting auto-recovery</span>
        <span class="ruby-identifier">throw</span> <span class="ruby-value">:racc_end_parse</span>, <span class="ruby-keyword">nil</span>
      <span class="ruby-keyword">end</span>
      <span class="ruby-ivar">@racc_read_next</span> = <span class="ruby-keyword">true</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-ivar">@racc_user_yyerror</span> = <span class="ruby-keyword">false</span>
    <span class="ruby-ivar">@racc_error_status</span> = <span class="ruby-value">3</span>
    <span class="ruby-keyword">while</span> <span class="ruby-keyword">true</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">i</span> = <span class="ruby-identifier">action_pointer</span>[<span class="ruby-ivar">@racc_state</span>[<span class="ruby-value">-1</span>]]
        <span class="ruby-identifier">i</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>   <span class="ruby-comment"># error token</span>
        <span class="ruby-keyword">if</span>  <span class="ruby-identifier">i</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-value">0</span> <span class="ruby-keyword">and</span>
            (<span class="ruby-identifier">act</span> = <span class="ruby-identifier">action_table</span>[<span class="ruby-identifier">i</span>]) <span class="ruby-keyword">and</span>
            <span class="ruby-identifier">action_check</span>[<span class="ruby-identifier">i</span>] <span class="ruby-operator">==</span> <span class="ruby-ivar">@racc_state</span>[<span class="ruby-value">-1</span>]
          <span class="ruby-keyword">break</span>
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">end</span>
      <span class="ruby-identifier">throw</span> <span class="ruby-value">:racc_end_parse</span>, <span class="ruby-keyword">nil</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@racc_state</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&lt;=</span> <span class="ruby-value">1</span>
      <span class="ruby-ivar">@racc_state</span>.<span class="ruby-identifier">pop</span>
      <span class="ruby-ivar">@racc_vstack</span>.<span class="ruby-identifier">pop</span>
      <span class="ruby-keyword">if</span> <span class="ruby-ivar">@yydebug</span>
        <span class="ruby-ivar">@racc_tstack</span>.<span class="ruby-identifier">pop</span>
        <span class="ruby-identifier">racc_e_pop</span> <span class="ruby-ivar">@racc_state</span>, <span class="ruby-ivar">@racc_tstack</span>, <span class="ruby-ivar">@racc_vstack</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">return</span> <span class="ruby-identifier">act</span>

  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;[Racc Bug] unknown action #{act.inspect}&quot;</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">racc_next_state</span>(<span class="ruby-ivar">@racc_state</span>[<span class="ruby-value">-1</span>], <span class="ruby-ivar">@racc_state</span>) <span class="ruby-keyword">if</span> <span class="ruby-ivar">@yydebug</span>

  <span class="ruby-keyword">nil</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-_racc_init_sysvars" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">_racc_init_sysvars</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="_racc_init_sysvars-source">
            <pre><span class="ruby-comment"># File rdoc/rd/block_parser.rb, line 265</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">_racc_init_sysvars</span>
  <span class="ruby-ivar">@racc_state</span>  = [<span class="ruby-value">0</span>]
  <span class="ruby-ivar">@racc_tstack</span> = []
  <span class="ruby-ivar">@racc_vstack</span> = []

  <span class="ruby-ivar">@racc_t</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@racc_val</span> = <span class="ruby-keyword">nil</span>

  <span class="ruby-ivar">@racc_read_next</span> = <span class="ruby-keyword">true</span>

  <span class="ruby-ivar">@racc_user_yyerror</span> = <span class="ruby-keyword">false</span>
  <span class="ruby-ivar">@racc_error_status</span> = <span class="ruby-value">0</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-_racc_setup" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">_racc_setup</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="_racc_setup-source">
            <pre><span class="ruby-comment"># File rdoc/rd/block_parser.rb, line 253</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">_racc_setup</span>
  <span class="ruby-ivar">@yydebug</span> = <span class="ruby-keyword">false</span> <span class="ruby-keyword">unless</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">class</span><span class="ruby-operator">::</span><span class="ruby-constant">Racc_debug_parser</span>
  <span class="ruby-ivar">@yydebug</span> = <span class="ruby-keyword">false</span> <span class="ruby-keyword">unless</span> <span class="ruby-keyword">defined?</span>(<span class="ruby-ivar">@yydebug</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@yydebug</span>
    <span class="ruby-ivar">@racc_debug_out</span> = <span class="ruby-identifier">$stderr</span> <span class="ruby-keyword">unless</span> <span class="ruby-keyword">defined?</span>(<span class="ruby-ivar">@racc_debug_out</span>)
    <span class="ruby-ivar">@racc_debug_out</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">$stderr</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">arg</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">class</span><span class="ruby-operator">::</span><span class="ruby-constant">Racc_arg</span>
  <span class="ruby-identifier">arg</span>[<span class="ruby-value">13</span>] = <span class="ruby-keyword">true</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">14</span>
  <span class="ruby-identifier">arg</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-_racc_yyparse_rb" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">_racc_yyparse_rb</span><span
                                class="method-args">(recv, mid, arg, c_debug)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="_racc_yyparse_rb-source">
            <pre><span class="ruby-comment"># File rdoc/rd/block_parser.rb, line 362</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">_racc_yyparse_rb</span>(<span class="ruby-identifier">recv</span>, <span class="ruby-identifier">mid</span>, <span class="ruby-identifier">arg</span>, <span class="ruby-identifier">c_debug</span>)
  <span class="ruby-identifier">action_table</span>, <span class="ruby-identifier">action_check</span>, <span class="ruby-identifier">action_default</span>, <span class="ruby-identifier">action_pointer</span>,
  <span class="ruby-identifier">_</span>,            <span class="ruby-identifier">_</span>,            <span class="ruby-identifier">_</span>,              <span class="ruby-identifier">_</span>,
  <span class="ruby-identifier">_</span>,            <span class="ruby-identifier">_</span>,            <span class="ruby-identifier">token_table</span>,    <span class="ruby-operator">*</span> = <span class="ruby-identifier">arg</span>

  <span class="ruby-identifier">_racc_init_sysvars</span>

  <span class="ruby-identifier">catch</span>(<span class="ruby-value">:racc_end_parse</span>) {
    <span class="ruby-keyword">until</span> <span class="ruby-identifier">i</span> = <span class="ruby-identifier">action_pointer</span>[<span class="ruby-ivar">@racc_state</span>[<span class="ruby-value">-1</span>]]
      <span class="ruby-keyword">while</span> <span class="ruby-identifier">act</span> = <span class="ruby-identifier">_racc_evalact</span>(<span class="ruby-identifier">action_default</span>[<span class="ruby-ivar">@racc_state</span>[<span class="ruby-value">-1</span>]], <span class="ruby-identifier">arg</span>)
        ;
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">recv</span>.<span class="ruby-identifier">__send__</span>(<span class="ruby-identifier">mid</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">tok</span>, <span class="ruby-identifier">val</span><span class="ruby-operator">|</span>
      <span class="ruby-keyword">unless</span> <span class="ruby-identifier">tok</span>
        <span class="ruby-ivar">@racc_t</span> = <span class="ruby-value">0</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-ivar">@racc_t</span> = (<span class="ruby-identifier">token_table</span>[<span class="ruby-identifier">tok</span>] <span class="ruby-keyword">or</span> <span class="ruby-value">1</span>)   <span class="ruby-comment"># error token</span>
      <span class="ruby-keyword">end</span>
      <span class="ruby-ivar">@racc_val</span> = <span class="ruby-identifier">val</span>
      <span class="ruby-ivar">@racc_read_next</span> = <span class="ruby-keyword">false</span>

      <span class="ruby-identifier">i</span> <span class="ruby-operator">+=</span> <span class="ruby-ivar">@racc_t</span>
      <span class="ruby-keyword">unless</span> <span class="ruby-identifier">i</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-value">0</span> <span class="ruby-keyword">and</span>
             <span class="ruby-identifier">act</span> = <span class="ruby-identifier">action_table</span>[<span class="ruby-identifier">i</span>] <span class="ruby-keyword">and</span>
             <span class="ruby-identifier">action_check</span>[<span class="ruby-identifier">i</span>] <span class="ruby-operator">==</span> <span class="ruby-ivar">@racc_state</span>[<span class="ruby-value">-1</span>]
        <span class="ruby-identifier">act</span> = <span class="ruby-identifier">action_default</span>[<span class="ruby-ivar">@racc_state</span>[<span class="ruby-value">-1</span>]]
      <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">while</span> <span class="ruby-identifier">act</span> = <span class="ruby-identifier">_racc_evalact</span>(<span class="ruby-identifier">act</span>, <span class="ruby-identifier">arg</span>)
        ;
      <span class="ruby-keyword">end</span>

      <span class="ruby-keyword">while</span> <span class="ruby-operator">!</span>(<span class="ruby-identifier">i</span> = <span class="ruby-identifier">action_pointer</span>[<span class="ruby-ivar">@racc_state</span>[<span class="ruby-value">-1</span>]]) <span class="ruby-operator">||</span>
            <span class="ruby-operator">!</span> <span class="ruby-ivar">@racc_read_next</span> <span class="ruby-operator">||</span>
            <span class="ruby-ivar">@racc_t</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>  <span class="ruby-comment"># $</span>
        <span class="ruby-keyword">unless</span> <span class="ruby-identifier">i</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">i</span> <span class="ruby-operator">+=</span> <span class="ruby-ivar">@racc_t</span> <span class="ruby-keyword">and</span>
               <span class="ruby-identifier">i</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-value">0</span> <span class="ruby-keyword">and</span>
               <span class="ruby-identifier">act</span> = <span class="ruby-identifier">action_table</span>[<span class="ruby-identifier">i</span>] <span class="ruby-keyword">and</span>
               <span class="ruby-identifier">action_check</span>[<span class="ruby-identifier">i</span>] <span class="ruby-operator">==</span> <span class="ruby-ivar">@racc_state</span>[<span class="ruby-value">-1</span>]
          <span class="ruby-identifier">act</span> = <span class="ruby-identifier">action_default</span>[<span class="ruby-ivar">@racc_state</span>[<span class="ruby-value">-1</span>]]
        <span class="ruby-keyword">end</span>
        <span class="ruby-keyword">while</span> <span class="ruby-identifier">act</span> = <span class="ruby-identifier">_racc_evalact</span>(<span class="ruby-identifier">act</span>, <span class="ruby-identifier">arg</span>)
          ;
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
  }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-next_token" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">next_token</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>The method to fetch next token. If you use do_parse method, you must implement <a href="Parser.html#method-i-next_token"><code>next_token</code></a>.</p>

<p>The format of return value is [TOKEN_SYMBOL, VALUE]. <code>token-symbol</code> is represented by Ruby’s symbol by default, e.g. :IDENT for ‘IDENT’.  “;” (String) for ‘;’.</p>

<p>The final symbol (End of file) must be false.</p>

                              <div class="method-source-code" id="next_token-source">
            <pre><span class="ruby-comment"># File rdoc/rd/block_parser.rb, line 308</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">next_token</span>
  <span class="ruby-identifier">raise</span> <span class="ruby-constant">NotImplementedError</span>, <span class="ruby-node">&quot;#{self.class}\#next_token is not defined&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-on_error" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">on_error</span><span
                                class="method-args">(t, val, vstack)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>This method is called when a parse error is found.</p>

<p>ERROR_TOKEN_ID is an internal ID of token which caused error. You can get string representation of this ID by calling <a href="Parser.html#method-i-token_to_str"><code>token_to_str</code></a>.</p>

<p>ERROR_VALUE is a value of error token.</p>

<p>value_stack is a stack of symbol values. DO NOT MODIFY this object.</p>

<p>This method raises <a href="ParseError.html"><code>ParseError</code></a> by default.</p>

<p>If this method returns, parsers enter “error recovering mode”.</p>

                              <div class="method-source-code" id="on_error-source">
            <pre><span class="ruby-comment"># File rdoc/rd/block_parser.rb, line 568</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">on_error</span>(<span class="ruby-identifier">t</span>, <span class="ruby-identifier">val</span>, <span class="ruby-identifier">vstack</span>)
  <span class="ruby-identifier">raise</span> <span class="ruby-constant">ParseError</span>, <span class="ruby-identifier">sprintf</span>(<span class="ruby-string">&quot;\nparse error on value %s (%s)&quot;</span>,
                            <span class="ruby-identifier">val</span>.<span class="ruby-identifier">inspect</span>, <span class="ruby-identifier">token_to_str</span>(<span class="ruby-identifier">t</span>) <span class="ruby-operator">||</span> <span class="ruby-string">&#39;?&#39;</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-racc_accept" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">racc_accept</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="racc_accept-source">
            <pre><span class="ruby-comment"># File rdoc/rd/block_parser.rb, line 617</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">racc_accept</span>
  <span class="ruby-ivar">@racc_debug_out</span>.<span class="ruby-identifier">puts</span> <span class="ruby-string">&#39;accept&#39;</span>
  <span class="ruby-ivar">@racc_debug_out</span>.<span class="ruby-identifier">puts</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-racc_e_pop" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">racc_e_pop</span><span
                                class="method-args">(state, tstack, vstack)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="racc_e_pop-source">
            <pre><span class="ruby-comment"># File rdoc/rd/block_parser.rb, line 622</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">racc_e_pop</span>(<span class="ruby-identifier">state</span>, <span class="ruby-identifier">tstack</span>, <span class="ruby-identifier">vstack</span>)
  <span class="ruby-ivar">@racc_debug_out</span>.<span class="ruby-identifier">puts</span> <span class="ruby-string">&#39;error recovering mode: pop token&#39;</span>
  <span class="ruby-identifier">racc_print_states</span> <span class="ruby-identifier">state</span>
  <span class="ruby-identifier">racc_print_stacks</span> <span class="ruby-identifier">tstack</span>, <span class="ruby-identifier">vstack</span>
  <span class="ruby-ivar">@racc_debug_out</span>.<span class="ruby-identifier">puts</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-racc_next_state" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">racc_next_state</span><span
                                class="method-args">(curstate, state)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="racc_next_state-source">
            <pre><span class="ruby-comment"># File rdoc/rd/block_parser.rb, line 629</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">racc_next_state</span>(<span class="ruby-identifier">curstate</span>, <span class="ruby-identifier">state</span>)
  <span class="ruby-ivar">@racc_debug_out</span>.<span class="ruby-identifier">puts</span>  <span class="ruby-node">&quot;goto    #{curstate}&quot;</span>
  <span class="ruby-identifier">racc_print_states</span> <span class="ruby-identifier">state</span>
  <span class="ruby-ivar">@racc_debug_out</span>.<span class="ruby-identifier">puts</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-racc_print_stacks" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">racc_print_stacks</span><span
                                class="method-args">(t, v)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="racc_print_stacks-source">
            <pre><span class="ruby-comment"># File rdoc/rd/block_parser.rb, line 635</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">racc_print_stacks</span>(<span class="ruby-identifier">t</span>, <span class="ruby-identifier">v</span>)
  <span class="ruby-identifier">out</span> = <span class="ruby-ivar">@racc_debug_out</span>
  <span class="ruby-identifier">out</span>.<span class="ruby-identifier">print</span> <span class="ruby-string">&#39;        [&#39;</span>
  <span class="ruby-identifier">t</span>.<span class="ruby-identifier">each_index</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">out</span>.<span class="ruby-identifier">print</span> <span class="ruby-string">&#39; (&#39;</span>, <span class="ruby-identifier">racc_token2str</span>(<span class="ruby-identifier">t</span>[<span class="ruby-identifier">i</span>]), <span class="ruby-string">&#39; &#39;</span>, <span class="ruby-identifier">v</span>[<span class="ruby-identifier">i</span>].<span class="ruby-identifier">inspect</span>, <span class="ruby-string">&#39;)&#39;</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">out</span>.<span class="ruby-identifier">puts</span> <span class="ruby-string">&#39; ]&#39;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-racc_print_states" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">racc_print_states</span><span
                                class="method-args">(s)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="racc_print_states-source">
            <pre><span class="ruby-comment"># File rdoc/rd/block_parser.rb, line 644</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">racc_print_states</span>(<span class="ruby-identifier">s</span>)
  <span class="ruby-identifier">out</span> = <span class="ruby-ivar">@racc_debug_out</span>
  <span class="ruby-identifier">out</span>.<span class="ruby-identifier">print</span> <span class="ruby-string">&#39;        [&#39;</span>
  <span class="ruby-identifier">s</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">st</span><span class="ruby-operator">|</span> <span class="ruby-identifier">out</span>.<span class="ruby-identifier">print</span> <span class="ruby-string">&#39; &#39;</span>, <span class="ruby-identifier">st</span> }
  <span class="ruby-identifier">out</span>.<span class="ruby-identifier">puts</span> <span class="ruby-string">&#39; ]&#39;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-racc_read_token" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">racc_read_token</span><span
                                class="method-args">(t, tok, val)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>For debugging output</p>

                              <div class="method-source-code" id="racc_read_token-source">
            <pre><span class="ruby-comment"># File rdoc/rd/block_parser.rb, line 591</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">racc_read_token</span>(<span class="ruby-identifier">t</span>, <span class="ruby-identifier">tok</span>, <span class="ruby-identifier">val</span>)
  <span class="ruby-ivar">@racc_debug_out</span>.<span class="ruby-identifier">print</span> <span class="ruby-string">&#39;read    &#39;</span>
  <span class="ruby-ivar">@racc_debug_out</span>.<span class="ruby-identifier">print</span> <span class="ruby-identifier">tok</span>.<span class="ruby-identifier">inspect</span>, <span class="ruby-string">&#39;(&#39;</span>, <span class="ruby-identifier">racc_token2str</span>(<span class="ruby-identifier">t</span>), <span class="ruby-string">&#39;) &#39;</span>
  <span class="ruby-ivar">@racc_debug_out</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">val</span>.<span class="ruby-identifier">inspect</span>
  <span class="ruby-ivar">@racc_debug_out</span>.<span class="ruby-identifier">puts</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-racc_reduce" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">racc_reduce</span><span
                                class="method-args">(toks, sim, tstack, vstack)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="racc_reduce-source">
            <pre><span class="ruby-comment"># File rdoc/rd/block_parser.rb, line 604</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">racc_reduce</span>(<span class="ruby-identifier">toks</span>, <span class="ruby-identifier">sim</span>, <span class="ruby-identifier">tstack</span>, <span class="ruby-identifier">vstack</span>)
  <span class="ruby-identifier">out</span> = <span class="ruby-ivar">@racc_debug_out</span>
  <span class="ruby-identifier">out</span>.<span class="ruby-identifier">print</span> <span class="ruby-string">&#39;reduce &#39;</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">toks</span>.<span class="ruby-identifier">empty?</span>
    <span class="ruby-identifier">out</span>.<span class="ruby-identifier">print</span> <span class="ruby-string">&#39; &lt;none&gt;&#39;</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">toks</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">t</span><span class="ruby-operator">|</span> <span class="ruby-identifier">out</span>.<span class="ruby-identifier">print</span> <span class="ruby-string">&#39; &#39;</span>, <span class="ruby-identifier">racc_token2str</span>(<span class="ruby-identifier">t</span>) }
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">out</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot; --&gt; #{racc_token2str(sim)}&quot;</span>
  <span class="ruby-identifier">racc_print_stacks</span> <span class="ruby-identifier">tstack</span>, <span class="ruby-identifier">vstack</span>
  <span class="ruby-ivar">@racc_debug_out</span>.<span class="ruby-identifier">puts</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-racc_shift" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">racc_shift</span><span
                                class="method-args">(tok, tstack, vstack)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="racc_shift-source">
            <pre><span class="ruby-comment"># File rdoc/rd/block_parser.rb, line 598</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">racc_shift</span>(<span class="ruby-identifier">tok</span>, <span class="ruby-identifier">tstack</span>, <span class="ruby-identifier">vstack</span>)
  <span class="ruby-ivar">@racc_debug_out</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;shift   #{racc_token2str tok}&quot;</span>
  <span class="ruby-identifier">racc_print_stacks</span> <span class="ruby-identifier">tstack</span>, <span class="ruby-identifier">vstack</span>
  <span class="ruby-ivar">@racc_debug_out</span>.<span class="ruby-identifier">puts</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-racc_token2str" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">racc_token2str</span><span
                                class="method-args">(tok)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="racc_token2str-source">
            <pre><span class="ruby-comment"># File rdoc/rd/block_parser.rb, line 651</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">racc_token2str</span>(<span class="ruby-identifier">tok</span>)
  <span class="ruby-keyword">self</span>.<span class="ruby-identifier">class</span><span class="ruby-operator">::</span><span class="ruby-constant">Racc_token_to_s_table</span>[<span class="ruby-identifier">tok</span>] <span class="ruby-keyword">or</span>
      <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;[Racc Bug] can&#39;t convert token #{tok} to string&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-token_to_str" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">token_to_str</span><span
                                class="method-args">(t)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Convert internal ID of token symbol to the string.</p>

                              <div class="method-source-code" id="token_to_str-source">
            <pre><span class="ruby-comment"># File rdoc/rd/block_parser.rb, line 657</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">token_to_str</span>(<span class="ruby-identifier">t</span>)
  <span class="ruby-keyword">self</span>.<span class="ruby-identifier">class</span><span class="ruby-operator">::</span><span class="ruby-constant">Racc_token_to_s_table</span>[<span class="ruby-identifier">t</span>]
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-yyaccept" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">yyaccept</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Exit parser. Return value is <code>Symbol_Value_Stack[0]</code>.</p>

                              <div class="method-source-code" id="yyaccept-source">
            <pre><span class="ruby-comment"># File rdoc/rd/block_parser.rb, line 581</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">yyaccept</span>
  <span class="ruby-identifier">throw</span> <span class="ruby-value">:racc_jump</span>, <span class="ruby-value">2</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-yyerrok" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">yyerrok</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Leave error recovering mode.</p>

                              <div class="method-source-code" id="yyerrok-source">
            <pre><span class="ruby-comment"># File rdoc/rd/block_parser.rb, line 586</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">yyerrok</span>
  <span class="ruby-ivar">@racc_error_status</span> = <span class="ruby-value">0</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-yyerror" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">yyerror</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Enter error recovering mode. This method does not call <a href="Parser.html#method-i-on_error"><code>on_error</code></a>.</p>

                              <div class="method-source-code" id="yyerror-source">
            <pre><span class="ruby-comment"># File rdoc/rd/block_parser.rb, line 575</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">yyerror</span>
  <span class="ruby-identifier">throw</span> <span class="ruby-value">:racc_jump</span>, <span class="ruby-value">1</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
              </main>



            </div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is provided by <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>. </p><p><a href="https://jamesbritt.bandcamp.com/">Hack your world.  Feed your head.  Live curious</a>.</p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

